<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>表单过滤选择器</title>
  <script src="js/jquery-3.7.1.min.js"></script>
  <script type="text/javascript">
    $(function () {
      // 获得所有button元素
      var $button = $(":button");
      $button.each(function () {
        console.log(this);
      })
      console.log("================")
      // 获得type="button"元素
      var $button2 = $("input[type='button']");
      $button2.each(function () {
        console.log(this);
      })
      console.log("================")
      // 获得标签为button的元素
      var $button3 = $("button");
      $button3.each(function () {
        console.log(this);
      })
    })
  </script>
</head>
<body>
<form>
  <input type="text"/><br/>
  <input type="checkbox"/><br/>
  <input type="radio"/><br/>
  <input type="image" src="./icon.png" height="100"/><br/>
  <input type="file"/><br/>
  <input type="submit"/><br/>
  <input type="reset"/><br/>
  <input type="password"/><br/>
  <input type="button" value="按钮1"/><br/>
  <select>
    <option/>
  </select><br/>
  <textarea></textarea><br/>
  <button>按钮2</button>
  <button>按钮3</button>
  <br/>
</form>
</body>
</html>
